export default {
    resourceDetail(params){
        return (async) => {
            ajax.get({
                url:'/v2/movie/subject/'+params.id ,
                data:""
            })
            .then((res) => {
                console.log('请求数据')
                async({
                    type:params.type,
                    resourceData:res
                })
            })
        }
    },
    getList1(params) {
        return (async) => {
            ajax.get({
                url : '/v2/movie/in_theaters',
                data:''
            })
            .then(function (resp) {
                ajax.get({
                    url : '/v2/movie/coming_soon',
                    data:''
                })
                .then(function (resp1) {
                    async({
                        type:params.type,
                        resourceData:{
                            nowData:resp1.subjects,
                            commingData:resp.subjects
                        }
                    })
                })
            })
        }
    },
    getBookData(params){
        return (async) => {
            ajax.get({
                url : 'v2/book/search?tag='+params.data,
                data:''
            })
            .then(function (resp) {
                async({
                    type:params.type,
                    resourceData:{
                        popular:resp.books
                    }
                })
            })
        }
    }
}